package com.zpark.pojo;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;

/**
 * @PackageName: com.zpark.pojo
 * @ClassName: Person
 * @Description:
 * @author: RZS
 * @date: 2024/4/22  11:50
 */
@Data
@NoArgsConstructor
@Slf4j
@Table(name = "person")  // 将实体类与数据表映射
public class Person implements Serializable {

    @Id // 将实体属性与数据表字段做映射
    @KeySql(useGeneratedKeys = true)
    private Integer id;

    @Column(name = "username") // Java中的属性与表字段默认是驼峰匹配
    private String username;

    @Column(name = "password")
    private String password;

    @Transient  // 忽略此属性与表字段映射
    private Integer age;  // 该属性不上表字段，需要忽略
}
